package com.top.art.tool;


import com.google.common.base.Strings;

/**
 * The type Mybatis tool.
 *
 * @author hjh
 */
public class Tool {

    /**
     * Not null and empty boolean.
     *
     * @param value the value
     * @return the boolean
     */
    public static boolean notNullAndEmpty(String value) {
        return !Strings.isNullOrEmpty(value);
    }

    /**
     * Not null and zero boolean.
     *
     * @param value the value
     * @return the boolean
     */
    public static boolean notNullAndZero(Long value) {
        return value != null && value > 0;
    }

    /**
     * Not null and zero boolean.
     *
     * @param value the value
     * @return the boolean
     */
    public static boolean notNullAndZero(Integer value) {
        return value != null && value > 0;
    }

    /**
     * Defalut int.
     *
     * @param a the a
     * @return the int
     */
    public static int defaultInteger(Integer a) {
        return a == null ? 0 : a;
    }
}
